package cn.kgc.novel.common;

public class Result {
    private Integer status;
    private String msg;
    private Object data;
    private Object datatwo;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Result(Object data){
        this.status = 200;
        this.msg ="OK";
        this.data = data;
    }
    public Result(Object data,Object datatwo){
        this.status = 200;
        this.msg ="OK";
        this.data = data;
        this.datatwo = datatwo;
    }
    public Result(Integer status, String msg, Object data){
        this.status = status;
        this.msg =msg;
        this.data = data;
    }
    public static Result ok(){
        return new Result(null);
    }

    public static Result ok(Object data){
        return new Result(data);
    }
    public static Result ok(Object data,Object datatwo){
        return new Result(data,datatwo);
    }
    public static Result ok(Integer status,String msg,Object data){
        return new Result(status, msg, data);
    }

    public static Result error(Integer status,String msg){
        return new Result(status, msg, null);
    }
    public static Result error(ErrorCodeEnum errorcodeEnum){
        return new Result(errorcodeEnum.value,errorcodeEnum.message,null);
    }

}
